package Entidad;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "fisioterapeuta")
@NamedQueries({@NamedQuery(name = "Fisioterapeuta.findAll", query = "SELECT f FROM Fisioterapeuta f"), @NamedQuery(name = "Fisioterapeuta.findByCedula", query = "SELECT f FROM Fisioterapeuta f WHERE f.cedula = :cedula"), @NamedQuery(name = "Fisioterapeuta.findByContraseña", query = "SELECT f FROM Fisioterapeuta f WHERE f.contraseña = :contraseña"), @NamedQuery(name = "Fisioterapeuta.findByNombre", query = "SELECT f FROM Fisioterapeuta f WHERE f.nombre = :nombre")})
public class Fisioterapeuta implements Serializable {

    private static final long serialVersionUID = 1L;

    /*llave primaria*/
    @Id
    @Column(name = "cedula",nullable=false)
    private Integer cedula;

    /*relaciones uno a muchos*/
    @OneToMany(mappedBy = "fValorador")
    private List<Afiliado> afiliados;

    /*atributos primitivos*/
    @Column(name = "contraseña",nullable=false)
    private String contraseña;

    @Column(name = "nombre",nullable=false)
    private String nombre;

    public List<Afiliado> getAfiliados() {
        return afiliados;
    }

    public void setAfiliados(List<Afiliado> afiliados) {
        this.afiliados = afiliados;
    }

    public Integer getCedula() {
        return cedula;
    }

    public void setCedula(Integer cedula) {
        this.cedula = cedula;
    }

    public String getContraseña() {
        return contraseña;
    }

    public void setContraseña(String contraseña) {
        this.contraseña = contraseña;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public Fisioterapeuta() {
    }

   
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (cedula != null ? cedula.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Fisioterapeuta)) {
            return false;
        }
        Fisioterapeuta other = (Fisioterapeuta) object;
        if ((this.cedula == null && other.cedula != null) || (this.cedula != null && !this.cedula.equals(other.cedula))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entidad.Fisioterapeuta[cedula=" + cedula + "]";
    }

}
